@extends('layouts.header')
@section('title','我的设备')
@section('content')
    <div class="myDevice">
        <div class="list">
            @foreach($groups as $group)
                <div class="item">
                    <div class="itemTop">
                        <div class="deviceInfo">
                            <p>设备号：<span>{{ $group->device->getNumber() }}</span></p>
                            <p>到期时间：<span>{{ $group->expired_at }}</span></p>
                        </div>
                        <div class="deviceStatus normal">{{ $group->humanStatus }}</div><!-- 正常 normal 维修 service -->
                    </div>
                    @if($group->status != 2)

                        <div class="itemBottom">
                            @if(! $group->isRefunding())
                            <div>
                                <a href="{{route('device.repairForm',['id'=>$group->id])}}">
                                    <img src="{{asset('icon/service.png')}}" alt="">
                                    <span>设备报修</span>
                                </a>
                            </div>
                            <div>
                                <a href="{{route('device.renewal',['id'=>$group->id])}}">
                                    <img src="{{asset('icon/xufei@2x.png')}}" alt="">
                                    <span>续费设备</span>
                                </a>
                            </div>
                            @endif
                            <div>
                                <a href="{{route('deposit.refund',['id'=>$group->id])}}">
                                    <img src="{{asset('icon/tuikuang@2x.png')}}" alt="">
                                    <span>申请退款</span>
                                </a>
                            </div>
                        </div>
                    @endif
                </div>
            @endforeach
        </div>
        <div class="noData">没有更多设备了</div>
    </div>

@endsection
@push('js')
@endpush
